<template>
	<view>
		<!-- <free-nav-bar showBack title="公告详情"></free-nav-bar> -->
		<view class="font-12 pl-2 pt-2 text-999999">来源：{{notices.source}}</view>
		<view class="font-12 pl-2 pt-2 text-999999">标题：{{notices.title}}</view>
		<view class="font-12 pl-2 pt-2 text-999999">发布时间：{{notices.releaseTime}}</view>
		<view class="pl-2 pr-2 mt-6 pb-2">
			<view class="text-333333 font-16 font-weight-bold-600 text-center pb-2">{{notices.title}}</view>
			<!-- <rich-text :nodes="notices.content"></rich-text> -->
			<u-parse :html="notices.content"></u-parse>
		</view>
	</view>
</template>

<script>
	import $H from "@/common/free-lib/request.js";
	import freeNavBar from "@/components/free-ui/free-nav-bar.vue";
	export default {
		components: {
			freeNavBar,
		},
		data() {
			return {
				notices: {}
			};
		},
		onLoad(option) {
			console.log("id", option);
			this.getNotice(option.id);
		},
		computed: {
			richTextNodes() {
				return this.parseHTML(this.htmlContent);
			},
		},
		methods: {
			getNotice(id) {
				$H.get(
					"/basisInform/platformNotice/queryById", {
						id,
					}, {}
				).then((res) => {
					if (!res.result) {
						uni.showToast({
							title: "未查询到相关信息",
							icon: "none",
						});
						return;
					}
					this.notices = res.result
				});
				$H.get(
					"/basisInform/platformNotice/upper/clickRead", {
						id,
					}, {}
				);
			},
		},
	};
</script>

<style>
</style>